 
<?php
echo $this->adminToolBar('campaign', 'add', '/admin/rates/add/', '/admin/rates/updaterates/', '/admin/rates/delete/');
?>


    <table border="1" width="100%" cellpadding="1" cellspacing="2">
	<form name="exform" id="exform" action="/admin/excursion/doedit/">
         <tr>
		<td width="15%">National Park</td>
		<td width="85%">
                    
                    <select name="park_id" id="park_id" class="input-2">
                         <option value="0">--select--</option>
                        <?php foreach($this->park_arr as $arr):?>
                       
                        <option value="<?php echo $arr["page_id"]?>"><?php echo $arr["title"]?></option>

                        <?php endforeach;?>
                    </select>
                </td>
	</tr>
       <tr>
		<td width="15%">Campaign Title</td>
		<td width="85%"><input type="text" name="title" id="title" value="" class="input-2" /></td>
	</tr>
         <tr>
		<td width="15%">Campaign Title (ru)</td>
		<td width="85%"><input type="text" name="title_ru" id="title_ru" value="" class="input-2" /></td>
	</tr>
        <tr>
		<td width="15%">Camping Description</td>
		
	    <td width="85%"><?php echo $this->EditorFck('description'); ?></td>
        </tr>
        <tr>
		<td width="15%">Camping Description (ru)</td>
		 <td width="85%"><?php echo $this->EditorFck('description_ru'); ?></td>
	</tr>
         <tr>
		<td width="15%">Active</td>
		<td width="85%"><input  type="checkbox" name="active" id="active" value="<?php echo $this->excursion_arr['active']; ?>" class="input-2" /></td>
	</tr>
        </form>
    </table>
<script type="text/javascript">
function savecampaign()
{
       var title=$('#title');
       var title_ru=$('#title_ru');
       var description=$('#description');
        var description_ru=$('#description_ru');
       var park_id=$('#park_id');
         if($('#active').attr('checked')==true)
            {
                active=1;

            }
            else{
                active=0;
            }
          if(title.val()=="")
              {
                  alert("title cannot be empty!");
                  title.focus();
                  return false;
              } else{
                      $.ajax({
                            type: "POST",
                            url: '/admin/campaign/doadd/',
                            data: ({title:title.val(),description:description.val(),title_ru:title_ru.val(),description_ru:description_ru.val(),active:active,park_id:park_id.val()}),
                            success: function(data, textStatus, XMLHttpRequest){
                            if(data != '') {
                                   alert(data);
                                 //  alert("successfully Added the   features");
                                    loadPage('/admin/campaign/');
                            }
                    },
                    complete: function complete(XMLHttpRequest, textStatus){
                     //   $("#loader_area").hide();
                    }
                    });

              }
		
}


function deletestructurefield(id,rateid,hotelid)
{
		$.ajax({
			type: "POST",
			url: '/admin/rates/deletestructuredata/',
			data: ({id:id}),
	    	        success: function(data, textStatus, XMLHttpRequest){
	    	   	if(data != '') {
                               alert(data);
                             //  alert("successfully Added the   features");
	    			loadPage('/admin/rates/ratefeatures/rate_id/'+rateid+'/hotelid/'+hotelid);
	    	   	}
	    	},
	    	complete: function complete(XMLHttpRequest, textStatus){
	            $("#loader_area").hide();
	        }
		});

}

</script>


